﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:c="clr-namespace:personalplaner.controls"
                    xmlns:v="clr-namespace:personalplaner.views">

    <Style x:Key="BackButtonStyle" TargetType="{x:Type Button}">
        <Setter Property="Foreground" Value="#E1000000"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border x:Name="NoBorder_HeaderCommandIntBorder" Background="Transparent" BorderBrush="Transparent" BorderThickness="1" CornerRadius="2" Margin="0" Opacity="0.6">
                        <Grid>
                            <Ellipse Height="50" Width="50" Stroke="{TemplateBinding Foreground}" StrokeThickness="5" VerticalAlignment="Center"/>
                            <Path Data="M 10,0 L 0,10 L 10,20 M 0,10 L 30,10" Stroke="{TemplateBinding Foreground}" StrokeThickness="5" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <!--<Setter TargetName="NoBorder_HeaderCommandIntBorder" Property="Opacity" Value="1"/>-->
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="NoBorder_HeaderCommandIntBorder" Storyboard.TargetProperty="Opacity" Duration="0:0:0.25" To="1"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="NoBorder_HeaderCommandIntBorder" Storyboard.TargetProperty="Opacity" Duration="0:0:0.25" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="Red"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1" x:Key="backgroundbrush">
        <LinearGradientBrush.GradientStops>
            <GradientStop Color="White" Offset="0"/>
            <GradientStop Color="White" Offset="0.6"/>
            <GradientStop Color="#FFEDEDED" Offset="1"/>
        </LinearGradientBrush.GradientStops>
    </LinearGradientBrush>
    
    <Style TargetType="{x:Type c:SimpleControlContainer}">
        <!--<Setter Property="Background" Value="WhiteSmoke"/>-->
        <Setter Property="Background" Value="{StaticResource backgroundbrush}"/>
        <Setter Property="Opacity" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type  c:SimpleControlContainer}" >

                    <!--<ContentPresenter ContentSource="SelectedItem" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />-->

                    <Grid Background="{TemplateBinding Background}">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="75"/>
                                <RowDefinition/>
                                <RowDefinition Height="20"/>
                            </Grid.RowDefinitions>
                            <Button Style="{StaticResource BackButtonStyle}" Height="55" Width="55" Command="{Binding MoveBackCommand}" HorizontalAlignment="Left" VerticalAlignment="Center">

                            </Button>

                            <!--<ContentControl Content="{Binding SelectedItem, RelativeSource={RelativeSource AncestorType={x:Type v:SimpleContainerControl}}}" Grid.Row="1" />-->
                            <ContentPresenter ContentSource="SelectedItem" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.Row="1" />

                        </Grid>
                    </Grid>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetProperty="Opacity" Duration="0:0:0.25" To="1"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetProperty="Opacity" Duration="0:0:0.25" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
</ResourceDictionary>